{% extends "base_site.html" %}
{% load i18n pagination_tags feedjack_extension_tags %}

{% block page_title %}{% trans "Blog" %}: {{ feed.name }} - {% trans 'Posts in' %} {{ block.super }}{% endblock %}
{% block extrameta %}
    <meta name="DC.title" content="{% trans 'Blog' %}: {{ feed.name }} - {% trans 'Posts in' %} {{ site.title }}" />
    <meta name="description" content="{% trans 'Blog' %} {{ feed.name }} {{ feed.tagline|safe }} - {% trans 'Posts in' %} {{ site.title }}' %}" />
{% endblock %}

{% block menu_extra %}
    {% if tag %}
        <li>
            <a href="{% url tag_subscribers_list tag.name %}" title="{% trans 'See the list of authors talking about this tag' %}">
                {% trans 'People talking about this' %}
            </a>
        </li>
        <li>
            <a href="{% url tag_feeds_list tag.name %}" title="{% trans 'See the list of blogs talking about this tag' %}">
                {% trans 'Blogs talking about this' %}
            </a>
        </li>
    {% endif %}
{% endblock %}

{% block content %}
    <h2>{% trans "Blog" %}: {{ feed.name }}</h2>
    <p class="description">{{ feed.feed.tagline|safe }}</p>

    {% if tag %}
        <div>
            <p>{% trans 'Posts under tag' %}: <strong>{{ tag }}</strong></p>
            <a href="{% url feed_show feed.pk %}" title="{% trans 'See all posts from' %} {{ feed.name }}">
                {% trans 'See the complete list of posts from this blog' %}
            </a>
        </div>
    {% endif %}
    
    {% autopaginate posts 20 %}
    {% for post in posts %}
        <div class="entry {% cycle 'even' 'odd' %}">
            <h3><a href="{% url post_show post.pk %}" title="{% trans 'Read ' %} {{ post.title|safe }}">
                    {{ post.title|striptags|safe }}
                </a>
            </h3>
            <div class="details">
                {% post_details post %}
            </div>
            <div class="content">
                {{ post.content|safe|striptags|truncatewords:"100" }} <a href="{% url post_show post.pk %}" title="{% trans 'Read more' %}">{% trans 'Read more' %}</a>
            </div>
        <!-- End .entry -->
        </div>
    {% endfor %}

    {% if tag %}
        <p>
            <a href="{% url tag_feeds_list tag.name %}" title="{% trans 'See the list of blogs talking about this tag' %}">
                {% trans 'Other blogs talking about ' %} {{ tag }}
            </a>
        </p>
    {% endif %}

    {% paginate %}
{% endblock %}

{% block right_column %}
    {% if tag %}
        <div>
            {% related_tags_for tag %}
        </div>
        <div>
        {# bug in sqlite3 feeds_about tag #}
        </div>
    {% endif %}
    <div>
        {% related_feeds_for feed %}
    </div>
    <div>
        {% tags_cloud_for_feed feed %}
    </div>
{% endblock %}